{extend name="public:layout" /}
{block name="title"}司机工资管理{/block}
{block name="head"}{/block}
{block name="body"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i> 司机工资管理</li>
            </ol>
        </div>
        <div class="ibox-content">
            <div class="toolbar">
                <form class="form-inline" method="post">
                    <div class="form-group">
                        <span>选择日期范围</span>
                        <input class="form-control" name="rangdate" id="rangdate" type="text" value="{$rangdate}" placeholder="日期范围">
                    </div>
                    <div class="form-group">
                        <span>设定平均油价</span>
                        <input class="form-control" name="oil_money" placeholder="设定平均油价" value="{$oil_money}">
                    </div>
                    <button type="submit" class="btn btn-info">
                        <i class="fa fa-search"></i> 搜索
                    </button>
                    <a href="javascript:;" onclick="importxls();" class="btn btn-primary">导出</a>
                </form>
            </div>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th width="50">#</th>
                    <th>司机姓名</th>
                    <th>联系电话</th>
                    <th>基本工资</th>
                    <th>里程系数(元/Km)</th>
                    <th>总里程（Km）</th>
                    <th>里程补贴（元）</th>
                    <th>请假天数</th>
                    <th>油量折抵(L)</th>
                    <th>平均油价(元/L)</th>
                    <th>折抵金额（元）</th>
                </tr>
                </thead>
                <tbody>
                {volist name="list" id="vo"}
                <tr>
                    <td>{$vo.aid}</td>
                    <td>{$vo.title}</td>
                    <td>{$vo.dri_phone}</td>
                    <td>{$vo.driver_wages}</td>
                    <td>{$vo.km_subsidy}</td>
                    <td>{$vo.sum_order_mileage}</td>
                    <td>{$vo.sum_order_mileage*$vo.km_subsidy}</td>
                    <td>
                        {gt name="vo.leave_arr" value="0"}
                        <span data-toggle="tooltip" data-placement="top" title="{:implode(',',$vo['leave_arr'])}">{:count($vo['leave_arr'])}天</span>
                        {else/}
                        {:count($vo['leave_arr'])}天
                        {/gt}
                    </td>
                    <td>{$vo.car_fue-$vo.sum_order_l}</td>
                    <td>{$oil_money}</td>
                    <td>{php} echo ($vo['car_fue']-$vo['sum_order_l'])*$oil_money {/php}</td>
                </tr>
                {/volist}
                </tbody>
            </table>
            <div class="clearfix"></div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script>
    $(function () {
        $('[data-toggle="tooltip"]').tooltip()
    });
    function importxls() {
        var rangdate = $('#rangdate').val();
        var oil_money = $('input[name="oil_money"]').val();
        location.href="/system/logic.driver/import.html?rangdate="+rangdate+'&oil_money='+oil_money;
    }
    In('laydate',function () {
        laydate.render({
            elem: '#rangdate',
            range: '~'
        });
    })
</script>
{/block}